<template>
  <div class="app">
    <button @click="handleClick1">点我获取学生信息</button>
    <button @click="handleClick2">点我获取汽车信息</button>
  </div>
</template>

<script>
    import axios from 'axios'
    export default {
        name:'App',
        methods: {
            async handleClick1(){
                // let r1 = await axios.get('https://api.github.com/search/users?q=atguigu')
                // console.log(r1.data)
                // let r2 = await axios.get('https://api.uixsj.cn/hitokoto/get?type=social')
                // console.log(r2.data)
                let r3 = await axios.get('http://localhost:8080/api1/students')
                console.log(r3.data)
            },
            async handleClick2(){
                let r4 = await axios.get('http://localhost:8080/api2/cars')
                console.log(r4.data)
            }
        },
    }
</script>

<style>
    .app {
        background-color: skyblue;
        padding: 20px;
    }
</style>